package com.game.gameshoppingcenter.service;

import com.game.gameshoppingcenter.dao.OrdersRepository;
import com.game.gameshoppingcenter.entities.Orders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service

public class OrdersService {
    @Autowired
    OrdersRepository ordersRepository;
    public Orders save( Orders orders){
        return ordersRepository.save(orders);
    }
    public List<Orders> getorders(){
        return ordersRepository.findAll();
    }
    public void delect(Orders orders){
       ordersRepository.delete(orders);
    }
    public Orders findByOrdersId(long id){
        return ordersRepository.findByOrdersId(id);
    }

}
